#pragma once
#include <string.h>
#include <stdlib.h>
#include "usersLoad.h"
#include "configLoad.h"
#include "plantillasLoad.h"
#include "jugadoresPlantillasLoad.h"
#include "futbolistasLoad.h"

/**
 * @brief Main participant menu
 *
 * @param userData struct of userdata
 */
void participantMenu(struct UserVars userData);

/**
 * @brief Creates a roster
 *
 * @param userData Loggen in user's info
 * @param configData The configuration data array of structs
 * @param plantillasData_ptr pointer to the roster data array
 */
void createRoster(struct UserVars userData,struct ConfigVars *configData,struct PlantillaVars **plantillasData_ptr);

/**
 * @brief Start configuring a roster
 *
 * @param userData Loggen in user's info
 * @param configData The configuration data array of structs
 * @param plantillasData_ptr pointer to the roster data array
 */
void confRoster(struct UserVars userData,struct ConfigVars *configData,struct PlantillaVars *plantillasData);

/**
 * @brief List rosters beloning to the user
 *
 * @param userData User's info
 * @param rosters rosters (plantillas) array
 */
void listRosters(struct UserVars userData,struct PlantillaVars *rosters);

/**
 * @brief Main roster configuration menu
 *
 * @param userData User's info
 * @param maxPlayers Max allowed players on a roster
 * @param plantillaID ID of the roster to configure
 * @param rosters array of rosters
 */
void confRosterMenu(struct UserVars userData, int maxPlayers, int plantillaID,struct PlantillaVars *rosters);


/**
 * @brief Print players on a roster
 *
 * @param rosterID ID of roster
 * @param roster_players_data rosters players relation array
 * @param players players array
 */
void listPlayersOnRoster(int rosterID,struct JugadoresPlantillaVars *roster_players_data, struct FutbolistaVars *players);

/**
 * @brief Print list of available players to add to an array
 *
 * @param rosterID ID of current roster
 * @param roster_players_data rosters players relation array
 * @param players players array
 */
void listAvailablePlayers(int rosterID, struct JugadoresPlantillaVars *rosters_players_data,struct FutbolistaVars *players);

/**
 * @brief Delete a roster
 *
 * @param userData
 * @param rosters_ptr
 */
void deleteRoster(struct UserVars userData,struct PlantillaVars **rosters_ptr);

void deleteFromRoster(int rosterID,struct JugadoresPlantillaVars **rosters_players_ptr);

void addPlayerToRoster(int rosterID,struct JugadoresPlantillaVars **rosters_players_data_ptr,struct FutbolistaVars *players,struct PlantillaVars *rosters);

void printRanking(struct PlantillaVars *plantillaData);
